package com.shiwaixiangcun.customer.ui.activity

import android.os.Bundle
import android.view.View
import com.shiwaixiangcun.customer.R
import com.shiwaixiangcun.customer.base.BaseActivity
import kotlinx.android.synthetic.main.activity_emergency_rescue.*
import kotlinx.android.synthetic.main.top_bar_transparent.*


/**
 * 应急救助页面
 */
class EmergencyRescueActivity : BaseActivity(), View.OnClickListener {
    override fun onClick(p0: View?) {
        val bundle = Bundle()
        when (p0?.id) {
            R.id.back_left -> {
                finish()
            }
            R.id.layout_way -> {

                readyGo(RescueWayActivity::class.java)
            }
            R.id.layout_phone -> {
                readyGo(TelephoneActivity::class.java)
            }
            R.id.layout_record -> {

                bundle.putString("name", "救助记录")
                bundle.putInt("image", R.drawable.empty_nodata)
                bundle.putString("message", "还没有救助记录")
                readyGo(NotOpenActivity::class.java, bundle)
            }
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_emergency_rescue)
        initViewAndEvent()
    }

    private fun initViewAndEvent() {

        tv_page_name.text = "应急救助"
        layout_way.setOnClickListener(this)
        layout_phone.setOnClickListener(this)
        layout_record.setOnClickListener(this)
        back_left.setOnClickListener(this)
    }
}
